package top.lshaci.learning.atguigu.interview3.spring.aop;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * CalcServiceImpl
 *
 * @author lshaci
 * @since 1.0.0
 */
@Slf4j
@Service
public class CalcServiceImpl implements CalcService {

    @Override
    public int div(int x, int y) {
        if (y == 0) {
            throw new NullPointerException();
        }
        int result = x / y;
        System.err.println("======> CalcServiceImpl::div ======> result = " + result);
        return result;
    }
}
